package com.jsb.laundry.dao;

import com.jsb.laundry.model.entity.FactoryList;
import com.jsb.laundry.model.vo.DeliveryListVo;
import com.jsb.laundry.model.vo.FactoryListVo;
import com.jsb.laundry.model.vo.ListVo;
import com.jsb.laundry.model.vo.WaybillListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DriverDao {
    /**
     * 工厂列表
     * @return
     */
    List<FactoryList> findByFactoryList(String driverStatus);
    List<FactoryList> findByOkFactory(String driverStatus);
    List<FactoryList> findByList(String driverStatus);

    /**
     * 查询用户是否是司机
     * @param userId
     * @return
     */
    String findByDriverStatus(String userId);

    /**
     * 工厂列表
     * @return
     */
    List<FactoryListVo> factoryList();

    /**
     * 运单列表
     * @return
     */
    List<WaybillListVo> waybillList(@Param("shopsId") String shopsId,@Param("driverStatus")String driverStatus);
    List<WaybillListVo> orderList(@Param("shopsId") String shopsId,@Param("driverStatus")String driverStatus);

    /**
     * 更新检查状态
     * @param orderItemId
     * @return
     */
    int checkStatus(@Param("orderItemId") String orderItemId,@Param("driverStatus") String driverStatus);

    WaybillListVo queryOrderInformation(@Param("orderItemId") String orderItemId,@Param("driverStatus") String driverStatus);

    FactoryList findByFactory(@Param("shopsId") String shopsId,@Param("driverStatus") String driverStatus);
    FactoryList findByFactoryOk(@Param("shopsId") String shopsId,@Param("driverStatus") String driverStatus);

    int updExceptionStatus(String orderItemId);

    int addException(@Param("orderFulfillmentsId")String orderFulfillmentsId,@Param("orderDirection")String orderDirection,@Param("orderItemId")String orderItemId);

    List<WaybillListVo> exceptionList(String shopsId);

    List<WaybillListVo> findByOk(String driverStatus);

    String findByDirection(String orderFulfillmentsId);

    int updateOrderStatus(@Param("list")List orderId,@Param("driverStatus")String driverStatus);

    List<String> findByOrderId(@Param("list") List orderFulfillmentsId);

    int factoryOrdersStatus(@Param("list")List orderId);

    int shopOrdersItemStatus(@Param("list") List subOrderIdList);
    int driverOrdersItemStatus(@Param("list") List subOrderIdList,@Param("driverStatus")String driverStatus,@Param("orderDirection")String orderDirection);

    int updException(@Param("img") String img,@Param("problem") String problem,@Param("orderItemId") String orderItemId);

    int rExceptionData(String orderItemId);

    List<String>  findByDirectionList(@Param("list")List subOrderIdList);

    List<ListVo> productsScanned(@Param("driverStatus")String driverStatus,@Param("shopsId") String shopsId);

    String findByOrderItemId(String orderFulfillmentsId);

    String findByOrderIdItme(String orderItemId);

    String findByDirectionOrderId(String orderId);

    int updateOrder(String shopOrdersItemStatus);

    int updateFactory(String factoryOrdersItemStatus);
    int addOrderDriver(@Param("orderId")String orderId,@Param("orderItemId")String orderItemId,@Param("orderDirection")String orderDirection);

    String findByOrderIdStr(String subOrderId);

    String findByorderItemId(String orderFulfillmentsId);

    List<DeliveryListVo> deliveryList(String keywords, String startTime, String endTime);

    String findByShopsId(String subOrderId);

    String findByShopsType(String shopsId);

    String findByOrderFulfillmentsId(String orderItemId);

    int updateShopsStatus(@Param("list") List list);
}
